<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/29
 * Time: 17:44
 */

namespace Admin\Model;


use Base\Model\BaseModel;
use Think\Page;

class FellowupstopInfoModel extends BaseModel
{
    protected $dbName = 'transplant_userinformation';
    protected $_auto = array(
        array('logtime','mydate','3','callback'),
    );
    /**
     *自动添加时间函数
     */
    protected function mydate(){
        return date("Y-m-d H:i:s");
    }
    protected $_link=array(
        //医生
        'doctor' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name'    => 'transplant_userinformation.doctor_info',
            'foreign_key' => 'doctorid',
            'parent_key' => 'id',
        ),
        //患者
        'patient' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name'    => 'transplant_userinformation.patient_info',
            'foreign_key' => 'userid',
            'parent_key' => 'id',
        ),
        //类型
        'fellow' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name'    => 'fellowupstoptype',
            'foreign_key' => 'stoptypeid',
            'parent_key' => 'id',
            'condition'=>'status=1'
        )
    );
}